﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Mbl.ParameterizedTest.AcceptanceTests.CalculatorTests
{
    [TestClass]
    public class Examples
    {
        [TestMethod]
        public void Adding_two_numbers_gives_the_sum()
        {
            ParameterizedTest
                .Setup(() => new Calculator())
                .For<int, int, int>(c => c.Add)
                .Given(2, 2).Expect(4).Because("It's the sum")
                .Given(0, 0).Expect(0).Because("Zero is the additive identity.")
                .Evaluate();
        }

        [TestMethod]
        public void Parameterized_tests_can_be_created_without_setup()
        {
            var calculator = new Calculator();

            ParameterizedTest                
                .For((int a, int b) => calculator.Add(a, b))
                .Given(2, 2).Expect(4).Because("It's the sum")
                .Given(0, 0).Expect(0).Because("Zero is the additive identity.")
                .Evaluate();
        }
    }
}
